package behavior.state.versionTwo;

import behavior.state.enums.TimeQuantum;
import lombok.extern.slf4j.Slf4j;

/**
 * @author huhaiqiang
 * @version V1.0
 * @description 正在睡觉状态类
 * @date 2018/12/21 11:13
 */
@Slf4j
public class Sleeping implements State {

    public void doSth(PersonB personB) {
        if (personB.getHour() > TimeQuantum.HOUR_FIVE.getHour() || personB.getHour() < TimeQuantum.HOUR_ONE.getHour()) {
            log.info("正在睡觉...");
        } else {
            personB.setState(new BusinessHours());
            personB.doSth();
        }
    }
}
